package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface ReportMapper  extends BaseMapper{

    @Select("select  count(tm.id)  as membercounts,CONCAT(rd.fyear,'-',rd.fmonth) as yearsandmonth " +
            "from  rpt_date  rd , t_member tm " +
            "where  rd.fdate = tm.REGTIME " +
            "and fyear =year(now()) " +
            "group by rd.fmonth")
    List<Map> memberReportByLastYear();

   @Select("select count(ts.id) as value ,ts.name  " +
           "from   t_order tor, t_setmeal ts " +
           "where  tor.setmeal_id  = ts.id " +
           "group by ts.id")
    List<Map> setmealProportion();
}
